{namespace me.traqk.app.create}

{template .createWidget}
  <select id="{$me.traqk.app.create.TYPE_SELECT_ID|id}" {if not $types}disabled{/if}>
    {if $types}
      {call .renderTypes /}
    {else}
      <option>Loading your types...</option>
    {/if}
{/template}

{template .renderTypes}
  <select id="{$me.traqk.app.create.TYPE_SELECT_ID|id}">
    <option value="new">New...</option>
    {foreach $type in $types}
      <option value="{$type.id}">{$type.name}</option>
    {/for}
  </select>
{/template}

{template .renderFields}
  {foreach $field in $fields}
    <div>
      {$field.name}:
      {switch $me.traqk.app.proto.Data.Field.Type}
        {case me.traqk.app.proto.Data.Field.Type.TEXT}
          <input type="text"></input>
        {case me.traqk.app.proto.Data.Field.Type.INT}
          <input type="text"></input>
        {case me.traqk.app.proto.Data.Field.Type.DOUBLE}
          <input type="text"></input>
        {case me.traqk.app.proto.Data.Field.Type.DATE}
          <input type="text"></input>
        {case me.traqk.app.proto.Data.Field.Type.LOCATION}
          <input type="text"></input>
        {default}
          Unknown field type! =S
      {/switch}
    </div>
  {/for}
{/template}